import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/work_count_entity.dart';

WorkCountEntity $WorkCountEntityFromJson(Map<String, dynamic> json) {
  final WorkCountEntity workCountEntity = WorkCountEntity();
  final int? acceptedCount = jsonConvert.convert<int>(json['acceptedCount']);
  if (acceptedCount != null) {
    workCountEntity.acceptedCount = acceptedCount;
  }
  final int? invalidCount = jsonConvert.convert<int>(json['invalidCount']);
  if (invalidCount != null) {
    workCountEntity.invalidCount = invalidCount;
  }
  final int? issuedCount = jsonConvert.convert<int>(json['issuedCount']);
  if (issuedCount != null) {
    workCountEntity.issuedCount = issuedCount;
  }
  final int? notIssuedCount = jsonConvert.convert<int>(json['notIssuedCount']);
  if (notIssuedCount != null) {
    workCountEntity.notIssuedCount = notIssuedCount;
  }
  final int? revokeCount = jsonConvert.convert<int>(json['revokeCount']);
  if (revokeCount != null) {
    workCountEntity.revokeCount = revokeCount;
  }
  final int? violationCount = jsonConvert.convert<int>(json['violationCount']);
  if (violationCount != null) {
    workCountEntity.violationCount = violationCount;
  }
  final int? workingCount = jsonConvert.convert<int>(json['workingCount']);
  if (workingCount != null) {
    workCountEntity.workingCount = workingCount;
  }
  return workCountEntity;
}

Map<String, dynamic> $WorkCountEntityToJson(WorkCountEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['acceptedCount'] = entity.acceptedCount;
  data['invalidCount'] = entity.invalidCount;
  data['issuedCount'] = entity.issuedCount;
  data['notIssuedCount'] = entity.notIssuedCount;
  data['revokeCount'] = entity.revokeCount;
  data['violationCount'] = entity.violationCount;
  data['workingCount'] = entity.workingCount;
  return data;
}

extension WorkCountEntityExtension on WorkCountEntity {
  WorkCountEntity copyWith({
    int? acceptedCount,
    int? invalidCount,
    int? issuedCount,
    int? notIssuedCount,
    int? revokeCount,
    int? violationCount,
    int? workingCount,
  }) {
    return WorkCountEntity()
      ..acceptedCount = acceptedCount ?? this.acceptedCount
      ..invalidCount = invalidCount ?? this.invalidCount
      ..issuedCount = issuedCount ?? this.issuedCount
      ..notIssuedCount = notIssuedCount ?? this.notIssuedCount
      ..revokeCount = revokeCount ?? this.revokeCount
      ..violationCount = violationCount ?? this.violationCount
      ..workingCount = workingCount ?? this.workingCount;
  }
}